<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<tiles:importAttribute/>
<html:html>
	
	<head>
		<link rel="SHORTCUT ICON" href="pages/images/favicon.ico"/>
		<link rel="stylesheet" href="pages/main.css" type="text/css"/>
		<link href="general.css" type="text/css" rel="stylesheet"/>
		<meta name="author" content="trainfinder"/>
		<meta name="keywords"
			content="tickets paris,promotion code eurostar,cheap eurostar,eurostar comparison,low price eurostar,train tickets,price comparison,bar chart,scanner,cheapest price,availability,travel,london,france,train,cheap eurostar,best price"/>	
		<META name="verify-v1" content="TjiIKuFNJvOroWZOWkYM/gyRiOrsxqdx1zPzVyJNPRY=" />
		<meta name="description"
			content="Provides you with cheap eurostar tickets displayed in a bar chart."/>
		<meta name="robots" content="ALL, INDEX, FOLLOW"/>
		<meta name="revisit-after" content="1 days"/>
				
		
		
		<meta http-equiv="Content-Language" content="en-GB"/>
		
		<title>train finder - the eurostar price comparison search engine</title>	
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2014931-1";
urchinTracker();
</script>
		<script type="text/javascript">
		<!--
				
	var outwardSelected = null;
	var returnSelected = null;

	var returnDate;
	var returnTime;
	var returnCity;
	var returnPrice1;
	var outwardPrice1;
	var returnPrice2;
	var outwardPrice2;
	var outwardDate;
	var outwardTime;
	var outwardCity;
	var outwardBarCount
	var returnBarCount			
	
	
	function radioSelectionReturn(item,date,time,city,price1,price2) { 
		mouseDownReturn(document.getElementById(item),date,time,city,price1,price2 );
	}

	function radioSelectionOutward(item,date,time,city,price1,price2) { 
		mouseDownOutward(document.getElementById(item),date,time,city,price1,price2);
	}

				
	function mouseOutOutward(t) {  
		if (t.getAttribute("bgcolor").toString() != "#eeeeee") { 
			if (outwardSelected==null || outwardSelected != t) {
				drawTable(t,"plain");
			} else {
				 drawTable(t,"pressed");
			}
		}		 
	} 

	function mouseOutReturn(t) {  
		if (t.getAttribute("bgcolor").toString() != "#eeeeee") {
			if (returnSelected==null || returnSelected != t) {
				drawTable(t,"plain");
			} else {
				drawTable(t,"pressed");
			}
		}
	} 
				
				
	function mouseOverOutward(t) { 	
		if (t.getAttribute("bgcolor").toString() != "#eeeeee") {
			if (outwardSelected==null || outwardSelected != t) {
				drawTable(t,"selected");
			} else {
				 drawTable(t,"pressed");
			}
		}
	}
				
	function mouseOverReturn(t) { 	
				
		bgColor = t.getAttribute("bgcolor").toString();
		
		if (bgColor != "#eeeeee") {
			if (returnSelected==null || returnSelected != t) {
				drawTable(t,"selected");
			} else {
				drawTable(t,"pressed");		
			}
		}
	}
				
	function mouseDownOutward(t,date,time,city,price1,price2) { 
		 
		if (outwardSelected!=null  ) { 
			drawTable(outwardSelected,"plain");
		}
					
		outwardSelected = t;
			
			outwardDate = date;
			outwardTime = time;
			outwardCity = city;
			outwardPrice1 = price1;
			outwardPrice2 = price2;
		drawTable(t,"pressed");
		
		setNextActivation();
		
	}
			
			
	function mouseDownReturn(t,date,time,city,price1,price2) { 
		if (returnSelected!=null  ) { 
			drawTable(returnSelected,"plain");
		}
					
		returnSelected = t;
			
			returnDate = date;
			returnTime = time;
			returnCity = city;
			returnPrice1 = price1;
			returnPrice2 = price2;
		drawTable(t,"pressed");
		
		setNextActivation();
	}	
	
	function setNextActivation() {
		dayNumberCount = parseInt(document.getElementById("colcounts").getAttribute("dayNumberCount"));
	
		enabled = (outwardSelected != null) && (returnSelected != null);
	
		if (dayNumberCount>0){
				for(var i=1;i<=dayNumberCount;i++) {
					if (enabled) {
						document.getElementById("nextBorder"+i).style.border="2pt solid rgb(255, 234, 66)";
					} else {
						document.getElementById("nextBorder"+i).style.border="";
					}
					document.getElementById("next"+i).disabled=!enabled;
				}
		}							
	}	
	
				
	function setBackground(element,color) {
			
		if (element == outwardSelected) {
			element.bgColor = "#000000";
		} else 	if (element == returnSelected) {
			element.bgColor = "#000000";
		} else if(element.getAttribute("isNotice")!="true") {
			element.bgColor = color;
		}
		
		index = element.getAttribute("index");	
		var radioButton;
		var prefix 
		if (index!=null) {
		
			if (element.getAttribute("id").toString().charAt(0) == 'o'){
				prefix = "radioOutward";
			} else {
				prefix = "radioReturn";
			}	
					
			if(element.bgColor == "#eeeeee") {
	 			document.getElementById(prefix+index).disabled = true;
			}	else {
				document.getElementById(prefix+index).disabled = false;
			}
		}
	}						
		
	
	function drawTable(t,type) { 
		
		
	
		if(type=="plain") {
			t.bgColor ="#ffea42";
		} else 	if(type=="pressed")	{
			t.bgColor = "#000000";
			
			index = t.getAttribute("index").toString();	
			
			if (t.getAttribute("id").toString().charAt(0) == 'o'){
					document.getElementById("radioOutward"+index).checked = true;
			} else {
					document.getElementById("radioReturn"+index).checked = true;
			}			
		} else 	if(type=="selected") {
			t.bgColor = "#888888";
		}

	}
		
	function submitEurostarBooking() {
 	
		 form = document.getElementById("bookingForm");
 
		document.getElementById("td_departureCity").value = outwardCity;
		document.getElementById("td_arrivalCity").value = returnCity;	
		document.getElementById("td_outwardDate").value = outwardDate;
		document.getElementById("td_outwardTime").value = outwardTime;
		document.getElementById("td_returnDate").value = returnDate;
		document.getElementById("td_returnTime").value = returnTime;
		document.getElementById("td_returnPrice1").value = returnPrice1;
		document.getElementById("td_outwardPrice1").value = outwardPrice1;
		document.getElementById("td_returnPrice2").value = returnPrice2;
		document.getElementById("td_outwardPrice2").value = outwardPrice2;
		document.getElementById("td_nbPaxChild").value = 0;
		document.getElementById("td_nbPaxYouth").value = 0;
		document.getElementById("td_nbPaxSenior").value = 0;
		document.getElementById("td_nbPaxAdult").value = 1;
		
		form.submit();
	}		
						
			google_ad_client = "pub-5107714513050617";
			google_ad_width = 160;
			google_ad_height = 600;
			google_ad_format = "160x600_as";
			google_ad_type = "text";
			google_ad_channel ="";
			google_color_border = "FFFFFF";
			google_color_link = "000000";
			google_color_bg = "FFFFFF";
			google_color_text = "666666";
			google_color_url = "666666";
				
				
			
 		
				
		//--></script>
		
	</head>
	<body >
		<a name="top"/>
		<!-- main layout -->
		<table>
			<tr>
				<td width="900" align="center">
					<tiles:get name="menu"/>
				</td>
				
			</tr>
			
			<tr>
				<td height="10"/ >
				
			</tr>
			
			<tr>
				<td>
					<tiles:get name="content"/>
				</td>
			</tr>
		</table>
		
	</body>
</html:html>